﻿<%@ Page Language="C#" MasterPageFile="~/Member/UserManage.master" AutoEventWireup="true"
    EnableEventValidation="false" CodeFile="CompanyJobList.aspx.cs" Inherits="Member_Job_JobList"
    Title="  企业职位管理" %>

<%@ Register Src="../../Control/PageNo.ascx" TagName="PageNo" TagPrefix="uc1" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContInfo" runat="server">

    <script type="text/javascript" src="../../js/jquery-cn.js"></script>

    <script type="text/javascript" src="../../js/jquery.js"></script>

    <script type="text/javascript">
        function SelectAll()
        {
            // 找到所有的 input 元素
            var ctllist = document.getElementsByTagName("input");
            var objcheckbox= document.getElementById("CheckBox2");     
            for( var i = 0; i< ctllist.length; i++)
            {
                if(ctllist[i].type == "checkbox" && ctllist[i].name.indexOf( "CheckBox1") >=0 )
                {   
                    if(objcheckbox.checked==true)     
                         ctllist[i].checked = true;
                    else
                         ctllist[i].checked = false;
                }
          
             }
         }
          
    function checkbox(){
        // 找到所有的 input 元素
        var ctllist = document.getElementsByTagName("input");
        var chec=false;             
        for( var i = 0; i< ctllist.length; i++){
            if( ctllist[i].type == "checkbox" && ctllist[i].name.indexOf( "CheckBox1") >=0){
                if(ctllist[i].checked==true){
                    chec=true;  
                }
            }           
        }
        if(chec==false){
            alert("请至少选择一项");
            return false;
        }else
        {
           return confirm("确定要删除吗？");
        }    
    }  
    
        function checkbox1(){
        // 找到所有的 input 元素
        var ctllist = document.getElementsByTagName("input");
        var chec=false;             
        for( var i = 0; i< ctllist.length; i++){
            if( ctllist[i].type == "checkbox" && ctllist[i].name.indexOf( "CheckBox1") >=0){
                if(ctllist[i].checked==true){
                    chec=true;  
                }
            }           
        }
        if(chec==false){
            alert("请至少选择一项");
            return false;
        }else
        {
           return confirm("确定要暂停此职位吗？");
        }    
    }  
    
     function checkbox2(){
        // 找到所有的 input 元素
        var ctllist = document.getElementsByTagName("input");
        var chec=false;             
        for( var i = 0; i< ctllist.length; i++){
            if( ctllist[i].type == "checkbox" && ctllist[i].name.indexOf( "CheckBox1") >=0){
                if(ctllist[i].checked==true){
                    chec=true;  
                }
            }           
        }
        if(chec==false){
            alert("请至少选择一项");
            return false;
        }else
        {
           return confirm("确定要发布此职位吗？");
        }    
    }          
    </script>

    <form id="form1" action="">
        <div id="sub_content">
            <div class="pagetitle">
                企业职位管理</div>
          <%--  <div class="tishi">
                <span>提&nbsp;示：</span>
                <p>
                    ·修改信息：审核通过才能上网，可以增加商机有效期及提升信息排名。</p>
                <p>
                    ·在操作选项中设置信息推荐，信息通过审核后可以在商铺首页显示推荐产品信息</p>
                <div class="clr">
                </div>
            </div>--%>
            <div class="main_Supply_nav">
                <ul id="menu">
                    <li id="menu1" runat="server"><a href="CompanyJobList.aspx?Verify=0">全部的</a></li>
                    <li id="menu2" runat="server"><a href="CompanyJobList.aspx?Verify=3">发布中的</a></li><li
                        id="menu3" runat="server"><a href="CompanyJobList.aspx?Verify=1">暂停的</a></li><li
                            id="menu4" runat="server"><a href="CompanyJobList.aspx?Verify=2">已过期的</a></li>
                </ul>
                <div style="text-align:right;">
                    职位标题：<asp:TextBox ID="txtpostion" runat="server" Height="17"></asp:TextBox>
                    <asp:Button ID="btnSelect" OnClick="btnSelect_Click" runat="server" Text="立即查询" CssClass="i_button">
                    </asp:Button>
                </div>
            </div>
            <asp:GridView ID="grdJob" DataKeyNames="ID" runat="server" AutoGenerateColumns="False"
                CellPadding="0" Font-Overline="False" CssClass="table_main" OnRowDeleting="grdExpo_RowDeleting"
                OnRowDataBound="grdJob_RowDataBound" >
                <EmptyDataTemplate>
                    <table cellpadding="0" cellspacing="0" width="100%">
                        <tr>
                            <td>
                                选项
                            </td>
                            <td>
                                职位名称
                            </td>
                            <td>
                                发布时间
                            </td>
                            <td>
                                截止时间
                            </td>
                            <td>
                                是否通过审核
                            </td>
                            <td>
                                是否推荐
                            </td>
                            <td>
                                状态
                            </td>
                            <td>
                                修改
                            </td>
                            <td>
                                删除
                            </td>
                        </tr>
                    </table>
                    <table width="100%" style="text-align: left">
                        <tr>
                            <td style="text-align:left">
                                <asp:Label ID="Label1" runat="server" ForeColor="red" Text="暂无数据"></asp:Label>
                            </td>
                        </tr>
                    </table>
                </EmptyDataTemplate>
                <Columns>
                    <asp:TemplateField HeaderText="选项">
                        <ItemTemplate>
                            <asp:CheckBox ID="CheckBox1" runat="server" />
                        </ItemTemplate>
                        <HeaderStyle CssClass="th20 tou" />
                        <ItemStyle CssClass="nolet" />
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="职位名称">
                        <ItemTemplate>
                            <a style="text-decoration: underline; border-bottom-color: Red; border-bottom: 0 solid black;"
                                href='JobEdit.aspx?id=<%# DataBinder.Eval(Container.DataItem,"ID") %>'>
                                <%# Eval("Position")%>
                            </a>
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="发布时间">
                        <ItemTemplate>
                            <%# GetShortDate(DataBinder.Eval(Container.DataItem, "AddDate").ToString())%>
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText=" 截止时间">
                        <ItemTemplate>
                            <%# GetShortDate(DataBinder.Eval(Container.DataItem, "EndDate").ToString())%>
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="是否通过审核">
                        <ItemTemplate>
                            <%# turncn(Convert.ToInt32(DataBinder.Eval(Container.DataItem, "verify")))%>
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="是否推荐">
                        <ItemTemplate>
                            <%# recommend(Convert.ToBoolean(DataBinder.Eval(Container.DataItem, "isRecommend")))%>
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="状态">
                        <ItemTemplate>
                            <%# DataBinder.Eval(Container.DataItem, "state")%>
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField>
                        <HeaderTemplate>
                            修改
                        </HeaderTemplate>
                        <ItemTemplate>
                            <a href='JobEdit.aspx?id=<%# DataBinder.Eval(Container.DataItem,"ID") %>'>修改</a>
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField>
                        <HeaderTemplate>
                            <asp:LinkButton ID="BtnDelete" runat="server">删除</asp:LinkButton>
                        </HeaderTemplate>
                        <ItemTemplate>
                            <asp:LinkButton ID="BtnDelete" runat="server" CausesValidation="False" CommandName="Delete"
                                OnClientClick="return confirm('确认要删除此行信息吗？')">删除</asp:LinkButton>
                        </ItemTemplate>
                    </asp:TemplateField>
                </Columns>
                <HeaderStyle BackColor="#EEEEEE" Font-Bold="True" ForeColor="Black" BorderColor="#DDDDDD"
                    Height="30px" /> 
            </asp:GridView>
            <div class="paging" >
                <p>
                    <uc1:PageNo ID="PageNo1" runat="server" />
                </p>
                <input id="CheckBox2" name="CheckBox2" onclick="SelectAll();" type="checkbox" />
                全选
                <asp:Button ID="btnDelete" runat="server" OnClientClick="return checkbox();" OnClick="btnDelete_Click"
                    Text="批量删除" CssClass="i_button" />
                <asp:Button ID="BtnRecord" runat="server" Text="暂停" CssClass="i_button1" OnClientClick="return checkbox1();"
                    OnClick="BtnRecord_Click" />
                <asp:Button ID="Button1" runat="server" Text="发布" CssClass="i_button1" OnClientClick="return checkbox2();"
                    OnClick="Button1_Click" />
            </div>
            <asp:HiddenField ID="HiddenField1" runat="server" />
        </div>
    </form>
</asp:Content>
